{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "tags": [
     "remove-cell"
    ]
   },
   "outputs": [],
   "source": [
    "import sys\n",
    "import os\n",
    "if not any(path.endswith('textbook') for path in sys.path):\n",
    "    sys.path.append(os.path.abspath('../../..'))\n",
    "from textbook_utils import *"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Exercises"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "+ Find the constant that minimizes squared loss for wait time. Include a measure of spread of individual wait times. Compare this fitted constant to the constant that results from using mean absolute loss. Which do you think is the better fit? \n",
    "\n",
    "+ Simulate the wait time for passengers waiting for the southbound C line. Use the same approach as in the earlier model that incorporates the actual arrival times of the buses that are scheduled to arrive 12 minutes apart. How does your simulation compare to the simulation for the northbound C ;ine buses?\n",
    "\n",
    "+ Create a new measure that takes on four values for the general time of day: morning commute, midday, evening commute, and night. What does the distribution for how late a bus is look like for these four groups?  (Examine the lateness of the bus for the northbound C line buses).\n",
    "\n",
    "+ The simulation had people arrive at random times throughout the study period with an equal chance of arriving at any of the times. In words, how might you adjust the simulation to reflect the uneven arrival times for the 4 times of day computed in the previous exercise? That is describe the urn and marbles that would represent this chance process. Consider whether a two-stage process with multiple urns might be conceptually easier way to describe the process.  "
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Tags",
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
